package com.hxd.mall.utils.local

import android.view.View
import com.hxd.mall.constant.HxdGlobalInfo.instance
import com.hxd.mall.utils.open.getCustomizeTag
import com.hxd.threelibrary.getUmClient

object BuriedPointManageUtil {

    fun setBuriedPoint(views: View?, position: String? = "") {
        views?.let { view ->
            tagIsEmpty(view) {
                //LoganUtil.clickStartTime(it)
                if (position!!.isEmpty()) {
                    //MobclickAgent.onEvent(instance, it)
                    getUmClient().onEvent(instance, it)
                } else {
                    getUmClient().onEvent(instance, "$it item $position")
                }
            }
        }
    }

    fun tagIsEmpty(view: View, callBack: (String) -> Unit) {
        view.getCustomizeTag().let {
            if (it.isNotEmpty()) {
                callBack(it)
            }
        }
    }
}
